home *** CD-ROM | disk | FTP | other *** search
/ ftp.uv.es / 2014.11.ftp.uv.es.tar / ftp.uv.es / pub / mac / graficos / hpgl-to-pict-hc.hqx / hp2pict deck / background_2802.txt < prev    next >
Text File  |  1982-12-17  |  6KB  |  292 lines

  1. -- background: 2802 from stack: in
  2. -- bmap block id: 3079
  3. -- flags: 4000
  4. -- background id: 0
  5. -- name: Plot.back
  6. ----- HyperTalk script -----
  7. --     hp2pict XCMD calls
  8. -- hp2pict "open",name ;  returns window pointer
  9. --    open blank window
  10. -- hp2pict "drawf",window pointer, filename w/ HPGL
  11. --    draw hp file contents to window
  12. -- hp2pict "drawc",window pointer, CONTAINTER w/ HPGL
  13. --    draw hp container contents to window
  14. -- hp2pict "fetch",window pointer, CONTAINTER w/ HPGL
  15. --    draw hp while fetching from comm link w/ "recvTo(...)" msg
  16. -- hp2pict "file",window pointer,filename for PICT
  17. --    save window pict as file
  18. -- hp2pict "clip",window pointer
  19. --    put window pict into clipbd
  20. -- hp2pict "print",window pointer
  21. --    print window pict
  22. -- hp2pict "close",window pointer
  23.  
  24.  
  25. on closeBackground
  26.   closeplot
  27. end closeBackground
  28.  
  29. on newPlot
  30.   global plotWindow, plotName
  31.   set cursor to watch
  32.   put the rect of bg button "plotsize" into plotsize
  33.   hp2pict "open", plotName, plotsize
  34.   put the result into plotWindow
  35.   show bkgnd button "Close plot"
  36.   show bkgnd button "Clip plot"
  37.   show bkgnd button "File"
  38.   show bkgnd button "Print"
  39.   --update
  40. end newPlot
  41.  
  42. on closeplot
  43.   global plotWindow
  44.   if (plotWindow is not empty) and (plotWindow is not 0) then
  45.     hp2pict "close",plotWindow
  46.     put empty into plotWindow
  47.   end if
  48.   hide bkgnd button "Close plot"
  49.   hide bkgnd button "Clip plot"
  50.   hide bkgnd button "File"
  51.   hide bkgnd button "Print"
  52. end closeplot
  53.  
  54.  
  55.  
  56. on clipPlot
  57.   global plotWindow, plotName
  58.   hp2pict "clip",plotWindow
  59.   put rect of bg button "plotsize" into plotsize
  60.   DoMenu "Paste Picture"
  61.   -- auto selects paint tool
  62.   put item 1 to 2 of plotsize into pt
  63.   drag from 0,0 to pt
  64.   choose browse tool
  65.   put plotName into field "title"
  66. end clipPlot
  67.  
  68. on printPlot
  69.   global plotWindow
  70.   hp2pict "print", plotWindow
  71. end printPlot
  72.  
  73. on filePlot
  74.   global plotWindow, plotName, plotPath
  75.   put plotName into filename
  76.   get offset(".",filename)
  77.   if it > 0 then put char 1 to it-1 of filename into filename
  78.   put plotPath & filename & ".Pict" into filename
  79.   hp2pict "file", plotWindow, filename
  80. end filePlot
  81.  
  82. on doHPfile
  83.   global plotWindow, plotName, plotPath
  84.   closePlot
  85.   put filename("TEXT") into hpfile
  86.   if hpfile = empty then exit doHPfile
  87.   put empty into f
  88.   repeat with i = length(hpfile) down to 1
  89.     if char i of hpfile = ":" then
  90.       put char 1 to i of hpfile into plotPath
  91.       exit repeat
  92.     end if
  93.     put char i of hpfile before f
  94.   end repeat
  95.   put f into plotName
  96.   newPlot
  97.   hp2pict "drawf", plotWindow, hpfile
  98.   -- the result contains full hp script from file
  99.   --get the result
  100.   --writetofile it,true,hpfile & ".2",false,"MPS "
  101.   --XCMD WriteToFile container,<usePathname>,<"name">,<append>,<creator>
  102. end doHPfile
  103.  
  104.  
  105. -- end plot.back
  106.  
  107.  
  108.  
  109. -- part 1 (button)
  110. -- low flags: 00
  111. -- high flags: 2000
  112. -- rect: left=451 top=21 right=41 bottom=471
  113. -- title width / last selected line: 0
  114. -- icon id / first selected line: 1013 / 1013
  115. -- text alignment: 1
  116. -- font id: 0
  117. -- text size: 12
  118. -- style flags: 0
  119. -- line height: 16
  120. -- part name: Next
  121. ----- HyperTalk script -----
  122. on mouseUp
  123.   visual effect wipe left
  124.   go to next card
  125. end mouseUp
  126.  
  127.  
  128.  
  129.  
  130. -- part 2 (button)
  131. -- low flags: 00
  132. -- high flags: 2000
  133. -- rect: left=449 top=4 right=23 bottom=470
  134. -- title width / last selected line: 0
  135. -- icon id / first selected line: 1014 / 1014
  136. -- text alignment: 1
  137. -- font id: 0
  138. -- text size: 12
  139. -- style flags: 0
  140. -- line height: 16
  141. -- part name: Prev
  142. ----- HyperTalk script -----
  143. on mouseUp
  144.   visual effect wipe right
  145.   go to previous card
  146. end mouseUp
  147.  
  148.  
  149.  
  150.  
  151. -- part 3 (button)
  152. -- low flags: 80
  153. -- high flags: A004
  154. -- rect: left=461 top=171 right=217 bottom=504
  155. -- title width / last selected line: 0
  156. -- icon id / first selected line: 5059 / 5059
  157. -- text alignment: 1
  158. -- font id: 0
  159. -- text size: 12
  160. -- style flags: 0
  161. -- line height: 16
  162. -- part name: File
  163. ----- HyperTalk script -----
  164. on mouseUp
  165.   filePlot
  166. end mouseUp
  167.  
  168.  
  169.  
  170. -- part 17 (button)
  171. -- low flags: 00
  172. -- high flags: A004
  173. -- rect: left=445 top=55 right=79 bottom=510
  174. -- title width / last selected line: 0
  175. -- icon id / first selected line: 0 / 0
  176. -- text alignment: 1
  177. -- font id: 0
  178. -- text size: 12
  179. -- style flags: 0
  180. -- line height: 16
  181. -- part name: Plot file
  182. ----- HyperTalk script -----
  183. on mouseUp
  184.   doHPfile
  185. end mouseUp
  186.  
  187.  
  188.  
  189. -- part 4 (button)
  190. -- low flags: 80
  191. -- high flags: A004
  192. -- rect: left=460 top=117 right=163 bottom=503
  193. -- title width / last selected line: 0
  194. -- icon id / first selected line: 1007 / 1007
  195. -- text alignment: 1
  196. -- font id: 0
  197. -- text size: 12
  198. -- style flags: 0
  199. -- line height: 16
  200. -- part name: Print
  201. ----- HyperTalk script -----
  202. on mouseUp
  203.   printPlot
  204. end mouseUp
  205.  
  206.  
  207.  
  208. -- part 6 (field)
  209. -- low flags: 00
  210. -- high flags: 0000
  211. -- rect: left=149 top=10 right=35 bottom=416
  212. -- title width / last selected line: 0
  213. -- icon id / first selected line: 0 / 0
  214. -- text alignment: 0
  215. -- font id: 3
  216. -- text size: 14
  217. -- style flags: 0
  218. -- line height: 18
  219. -- part name: title
  220.  
  221.  
  222. -- part 9 (button)
  223. -- low flags: 80
  224. -- high flags: A004
  225. -- rect: left=441 top=55 right=81 bottom=512
  226. -- title width / last selected line: 0
  227. -- icon id / first selected line: 0 / 0
  228. -- text alignment: 1
  229. -- font id: 0
  230. -- text size: 12
  231. -- style flags: 0
  232. -- line height: 16
  233. -- part name: Close Plot
  234. ----- HyperTalk script -----
  235. on mouseUp
  236.   closeplot
  237. end mouseUp
  238.  
  239.  
  240.  
  241. -- part 11 (button)
  242. -- low flags: 80
  243. -- high flags: A004
  244. -- rect: left=449 top=86 right=109 bottom=510
  245. -- title width / last selected line: 0
  246. -- icon id / first selected line: 0 / 0
  247. -- text alignment: 1
  248. -- font id: 0
  249. -- text size: 12
  250. -- style flags: 0
  251. -- line height: 16
  252. -- part name: Clip Plot
  253. ----- HyperTalk script -----
  254. on mouseUp
  255.   clipPlot
  256. end mouseUp
  257.  
  258.  
  259.  
  260. -- part 18 (button)
  261. -- low flags: 00
  262. -- high flags: 2000
  263. -- rect: left=473 top=4 right=22 bottom=494
  264. -- title width / last selected line: 0
  265. -- icon id / first selected line: 29019 / 29019
  266. -- text alignment: 1
  267. -- font id: 0
  268. -- text size: 12
  269. -- style flags: 0
  270. -- line height: 16
  271. -- part name: to TOC
  272. ----- HyperTalk script -----
  273. on mouseUp
  274.   visual effect wipe down
  275.   go to card "TOC"
  276. end mouseUp
  277.  
  278.  
  279.  
  280. -- part 20 (button)
  281. -- low flags: 00
  282. -- high flags: 0000
  283. -- rect: left=0 top=48 right=342 bottom=437
  284. -- title width / last selected line: 0
  285. -- icon id / first selected line: 0 / 0
  286. -- text alignment: 1
  287. -- font id: 0
  288. -- text size: 12
  289. -- style flags: 0
  290. -- line height: 16
  291. -- part name: plotsize
  292.